package com.example.list_day3;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;


public class RecycleViewActivity extends AppCompatActivity {

    private RecyclerView mRecycleView;
    private MyAdapter myAdapter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycle_view);
        mRecycleView = findViewById(R.id.rv_content);
        mRecycleView.setLayoutManager(new LinearLayoutManager(this));       //显示列表
        myAdapter = new MyAdapter();
        mRecycleView.setAdapter(myAdapter);
    }
}
